<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('address/index')}">收货列表管理</a></li>
        <li ><a href="{:url('address/add')}">添加收货</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="get" action="{:url('address/index')}">
        <input type="text" class="form-control" name="keyword" style="width: 200px;" value="" placeholder="支持标题名称查询">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('address/index')}">清空</a>
    </form>
    <form method="post" action="{:url('address/px')}" class="js-ajax-form margin-top-20" >
        <div class="table-actions">
            <button type="submit" class="btn btn-primary btn-sm js-ajax-submit">排序</button>
        </div>

        <div style="margin: 10px 0;">
            <div style="margin: 10px 0;"></div>
            <table class="table table-hover table-bordered table-list">
                <thead>
                <tr>
                    <th><input type="checkbox" onclick="checkAll(this)"></th>
                    <th>排序</th>
                    <th>ID</th>
                    <th>收货人</th>
                    <th>手机号</th>
                    <th>收货地址</th>
                    <th>详细地址</th>

                    <th>操作</th>
                </tr>
                </thead>
                <tbody>

                <foreach name="list" item="vo">
                    <tr>
                        <td><input type="checkbox" name="id[]" value="{$vo.id}"></td>
                        <td><input type="text" name="list_orders[{$vo.id}]" value="{$vo.list_order}" class="input-order"></td>
                        <td>{$vo.id}</td>
                        <td>{$vo.name}</td>
                        <td>{$vo.mobile}</td>
                        <td>{$vo.address}</td>
                        <td>{$vo.address_more}</td>

                        <td>
                            <a href="{:url('address/edit',array('id'=>$vo['id']))}">
                                <span class="btn btn-xs btn-primary" title="{:lang('EDIT')}" data-toggle="tooltip">
                                    <i class="fa fa-edit fa-fw"></i>
                                </span>
                            </a>

                            <a href="{:url('address/delete',array('id'=>$vo['id']))}" class="btn btn-xs btn-danger js-ajax-delete" data-toggle="tooltip" title="{:lang('DELETE')}" data-msg="确定删除吗？">
                                <i class="fa fa-trash fa-fw"></i>
                                </span>
                            </a>
                        </td>
                    </tr>
                </foreach>
                </tbody>
            </table>
            <div class="pagination">
                {$list->render()}
            </div>
        </div>
    </form>

</div>
<script type="text/javascript" src="__STATIC__/js/admin.js?v={}"></script>
<script>
    function checkAll(obj){
        var checkbox = document.getElementsByName('id[]')
        for(let i = 0; i<checkbox.length; i++){
            checkbox[i].checked = obj.checked;

        }
    }
</script>
</body>
</html>
